package com.inspur.cmis.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.inspur.cmis.mapper.UserMapper;
import com.inspur.cmis.pojo.User;
import com.inspur.cmis.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserMapper userMapper;

	@Override
	public User getUser(User user) {
		User checkUser=userMapper.getUser(user);
        return checkUser;
	}

	/**
	 * 检索用户列表
	 */
	@Override
	public List<User> getUserInfoList(Map<String,String> map) {
		List<User> userList=userMapper.getUserInfoList(map);
		return userList;
	}

	@Override
	public void deleteUsers(int[] user_Ids) {
		userMapper.deleteUsers(user_Ids);
	}

	@Override
	public void addUser(User user) {
		userMapper.addUser(user);
	}

	@Override
	public List<User> getUserByCname(String cname) {
		// TODO Auto-generated method stub
		List<User> userList=userMapper.getUserByCname(cname);
		return userList;
	}

	/**
	 * 根据用户编号，查询用户信息
	 */
	@Override
	public User getUserById(Integer id) {
		User user=userMapper.getUserById(id);
		return user;
	}

	@Override
	public void updateUserInfo(User user) {
		userMapper.updateUserInfo(user);
	}

	/**
	 * 批量导入
	 */
	@Override
	public void importUser(List<User> userList) {
		userMapper.importUser(userList);
	}
}
